package com.hsy.springmvc.service.impl;

import com.hsy.springmvc.dao.IUserDao;
import com.hsy.springmvc.model.User;
import com.hsy.springmvc.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by hsy on 2017/12/29.
 */
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserDao userDao;

    public int saveBean(User user) {
        userDao.saveBean(user);
        return 1;
    }

    public int addBean(User user) {
        userDao.saveBean(user);
        return 1;
    }

    public int delete() {
        return 0;
    }

    public User get(Long id) {
        User user = userDao.get(User.class, id);
        return user;
    }

    public int update() {
        return 0;
    }
}
